package com.tucy.logistics.common.base;

import lombok.Getter;

/**
 * author: tcy
 * description:数据状态枚举
 */
@Getter
public enum BaseEnum implements EnumInterface {

    DELETE("delete",0,"删除"),
    NORMAL("normal",1,"正常"),
    BAN("ban",2,"封禁");

    /**
     * 编码
     */
    private String code;

    /**
     * 值
     */
    private Integer value;


    /**
     * 键
     */
    private String key;

    BaseEnum(String code, int value, String key) {
        this.code = code;
        this.value = value;
        this.key = key;
    }

    public static BaseEnum getByValue(Integer value) {

        BaseEnum baseEnum = null;

        for (BaseEnum item : values()) {
            if (item.getValue().equals(value)) {
                baseEnum = item;
                continue;
            }
        }
        return baseEnum;
    }

}
